package dkzcm.club.article.common.enums;

import lombok.Getter;

/**
 * @desc:
 * @author: xk
 * @version: 1.0
 * Create by 2024/12/5 21:48
 */

@Getter
public enum IsDeleteFlagEnum {
    DELETE(1, "已删除"),
    UN_DELETE(0, "未删除");

    public int code;
    public String desc;

    IsDeleteFlagEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static IsDeleteFlagEnum getByCode(int codeVal) {
        for (IsDeleteFlagEnum isDeleteFlagEnum : IsDeleteFlagEnum.values()) {
            if (isDeleteFlagEnum.code == codeVal) {
                return isDeleteFlagEnum;
            }
        }
        return null;
    }
}
